<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/details/sslSvrEpoll.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_ae5bdaf1b45f3c0e6fd5dd3984d2eafd.html">details</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">sslSvrEpoll.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../de/ddb/ssl_svr_epoll_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#include &quot;<a class="code" href="../../df/d6c/ssl_svr_itfc_8hpp.html">details/sslSvrItfc.hpp</a>&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html">   11</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d9/d86/classssl_svr_epoll.html">sslSvrEpoll</a> : <span class="keyword">public</span> <a class="code hl_struct" href="../../dd/dd6/structssl_svr_itfc.html">sslSvrItfc</a></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>{</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html#add8cf53ef02e1144cdd5952e63ccf8fc">   14</a></span>    <span class="keyword">using </span><a class="code hl_class" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html">dispatcher_t</a> = <a class="code hl_typedef" href="../../dd/dd6/structssl_svr_itfc.html#a48c796d2a1cd0e9a2320443f84d8c2ad">sslSvrItfc::dispatcher_t</a>;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>    std::string   m_addr__;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    std::atomic&lt; uint16_t &gt;      m_port__;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    std::atomic&lt; int &gt;           m_sock__;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#a9eb56417e377f8ddf2556342bb6c4470">sslSvrEpoll</a>( <span class="keyword">const</span> std::string&amp; ip , uint16_t port , <span class="keyword">const</span> std::string&amp; ca, <span class="keyword">const</span> std::string&amp; cert , <span class="keyword">const</span> std::string&amp; key );</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html#aa7fe1fc1ee17ac4a518cbf1b2ea9d324">   21</a></span>    <span class="keyword">virtual</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#aa7fe1fc1ee17ac4a518cbf1b2ea9d324">~sslSvrEpoll</a>(){}</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#af934a01f869357f8d58affa2672b9394">start</a>( <span class="keywordtype">int</span> maxConn = 100 );</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#a9c6cbadf49fc611758c58cae8de19f46">stop</a>();</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="foldopen" id="foldopen00027" data-start="{" data-end="}">
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html#a686be7f2a4aa033e25679d31db06ea5e">   27</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#a686be7f2a4aa033e25679d31db06ea5e">connect</a>( <span class="keyword">const</span> <a class="code hl_enumeration" href="../../dd/dd6/structssl_svr_itfc.html#a95757ce1105f2ed0770d8c94aa581898">event</a>&amp; cmd ,  <a class="code hl_typedef" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#aff9890b6c334da4a5ab289b54d04effe">dispatcher_t::evt_func_type</a> func ){</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>        <a class="code hl_class" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html">dispatcher_t</a> * dispt = <a class="code hl_function" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173">dispatcher_t::get</a>();</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>        <span class="keywordflow">return</span> dispt-&gt;<a class="code hl_function" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#accec6f12134ea9831ced6979d7b7c299">connect</a>( cmd , func );</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    }</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> <span class="keyword">class</span>Type , <span class="keyword">typename</span> funcType &gt;</div>
<div class="foldopen" id="foldopen00036" data-start="{" data-end="}">
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html#a973cb4d7859824d5328bd884023b1f42">   36</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#a973cb4d7859824d5328bd884023b1f42">connect</a>( <span class="keyword">const</span> <a class="code hl_enumeration" href="../../dd/dd6/structssl_svr_itfc.html#a95757ce1105f2ed0770d8c94aa581898">event</a>&amp; cmd , funcType classType::* func  ){</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>        <a class="code hl_class" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html">dispatcher_t</a> * dispt = <a class="code hl_function" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173">dispatcher_t::get</a>();</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>        <span class="keywordflow">return</span> dispt-&gt;<a class="code hl_function" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#accec6f12134ea9831ced6979d7b7c299">connect</a>( cmd , func );</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    }</div>
</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> <span class="keyword">class</span>Type , <span class="keyword">typename</span> funcType &gt;</div>
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d9/d86/classssl_svr_epoll.html#a922a0adff504e42dc24774c8a18df5e1">   42</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/d86/classssl_svr_epoll.html#a922a0adff504e42dc24774c8a18df5e1">connect</a>( <span class="keyword">const</span> <a class="code hl_enumeration" href="../../dd/dd6/structssl_svr_itfc.html#a95757ce1105f2ed0770d8c94aa581898">event</a>&amp; cmd , funcType classType::* func , classType * obj ){</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>        <a class="code hl_class" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html">dispatcher_t</a> * dispt = <a class="code hl_function" href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173">dispatcher_t::get</a>();</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        <span class="keywordflow">return</span> dispt-&gt;<a class="code hl_function" href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#accec6f12134ea9831ced6979d7b7c299">connect</a>( cmd , func , obj );</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    }</div>
</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    <span class="keywordtype">void</span> process_accept__();</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>    <span class="keywordtype">void</span> process_read__( <span class="keywordtype">int</span> socket );</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>};</div>
</div>
<div class="ttc" id="aclassssl_svr_epoll_html"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html">sslSvrEpoll</a></div><div class="ttdef"><b>定义</b> <a href="#l00011">sslSvrEpoll.hpp:12</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_a686be7f2a4aa033e25679d31db06ea5e"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#a686be7f2a4aa033e25679d31db06ea5e">sslSvrEpoll::connect</a></div><div class="ttdeci">bool connect(const event &amp;cmd, dispatcher_t::evt_func_type func)</div><div class="ttdef"><b>定义</b> <a href="#l00027">sslSvrEpoll.hpp:27</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_a922a0adff504e42dc24774c8a18df5e1"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#a922a0adff504e42dc24774c8a18df5e1">sslSvrEpoll::connect</a></div><div class="ttdeci">bool connect(const event &amp;cmd, funcType classType::*func, classType *obj)</div><div class="ttdef"><b>定义</b> <a href="#l00042">sslSvrEpoll.hpp:42</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_a973cb4d7859824d5328bd884023b1f42"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#a973cb4d7859824d5328bd884023b1f42">sslSvrEpoll::connect</a></div><div class="ttdeci">bool connect(const event &amp;cmd, funcType classType::*func)</div><div class="ttdoc">连接命令和函数指针指向的处理函数</div><div class="ttdef"><b>定义</b> <a href="#l00036">sslSvrEpoll.hpp:36</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_a9c6cbadf49fc611758c58cae8de19f46"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#a9c6cbadf49fc611758c58cae8de19f46">sslSvrEpoll::stop</a></div><div class="ttdeci">void stop()</div><div class="ttdef"><b>定义</b> <a href="../../db/d1c/ssl_svr_epoll_8cpp_source.html#l00070">sslSvrEpoll.cpp:70</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_a9eb56417e377f8ddf2556342bb6c4470"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#a9eb56417e377f8ddf2556342bb6c4470">sslSvrEpoll::sslSvrEpoll</a></div><div class="ttdeci">sslSvrEpoll(const std::string &amp;ip, uint16_t port, const std::string &amp;ca, const std::string &amp;cert, const std::string &amp;key)</div><div class="ttdef"><b>定义</b> <a href="../../db/d1c/ssl_svr_epoll_8cpp_source.html#l00011">sslSvrEpoll.cpp:11</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_aa7fe1fc1ee17ac4a518cbf1b2ea9d324"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#aa7fe1fc1ee17ac4a518cbf1b2ea9d324">sslSvrEpoll::~sslSvrEpoll</a></div><div class="ttdeci">virtual ~sslSvrEpoll()</div><div class="ttdef"><b>定义</b> <a href="#l00021">sslSvrEpoll.hpp:21</a></div></div>
<div class="ttc" id="aclassssl_svr_epoll_html_af934a01f869357f8d58affa2672b9394"><div class="ttname"><a href="../../d9/d86/classssl_svr_epoll.html#af934a01f869357f8d58affa2672b9394">sslSvrEpoll::start</a></div><div class="ttdeci">bool start(int maxConn=100)</div><div class="ttdef"><b>定义</b> <a href="../../db/d1c/ssl_svr_epoll_8cpp_source.html#l00043">sslSvrEpoll.cpp:43</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1dispatcher_html"><div class="ttname"><a href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html">wheels::dm::dispatcher</a></div><div class="ttdef"><b>定义</b> <a href="../../da/d26/dispatcher_8hpp_source.html#l00029">dispatcher.hpp:33</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1dispatcher_html_accec6f12134ea9831ced6979d7b7c299"><div class="ttname"><a href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#accec6f12134ea9831ced6979d7b7c299">wheels::dm::dispatcher::connect</a></div><div class="ttdeci">bool connect(const cmdType &amp;cmd, std::function&lt; evt_func_type &gt; func)</div><div class="ttdoc">连接命令和执行部分</div><div class="ttdef"><b>定义</b> <a href="../../da/d26/dispatcher_8hpp_source.html#l00114">dispatcher.hpp:114</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1dispatcher_html_aff9890b6c334da4a5ab289b54d04effe"><div class="ttname"><a href="../../dd/d08/classwheels_1_1dm_1_1dispatcher.html#aff9890b6c334da4a5ab289b54d04effe">wheels::dm::dispatcher::evt_func_type</a></div><div class="ttdeci">void(const variant &amp;) evt_func_type</div><div class="ttdef"><b>定义</b> <a href="../../da/d26/dispatcher_8hpp_source.html#l00035">dispatcher.hpp:35</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1singleton_html_ab064e1d47abf923e4ae0deaac875c173"><div class="ttname"><a href="../../de/d44/classwheels_1_1dm_1_1singleton.html#ab064e1d47abf923e4ae0deaac875c173">wheels::dm::singleton&lt; dispatcher&lt; cmdType &gt; &gt;::get</a></div><div class="ttdeci">static T * get()</div><div class="ttdef"><b>定义</b> <a href="../../de/d6d/singleton_8hpp_source.html#l00059">singleton.hpp:59</a></div></div>
<div class="ttc" id="assl_svr_itfc_8hpp_html"><div class="ttname"><a href="../../df/d6c/ssl_svr_itfc_8hpp.html">sslSvrItfc.hpp</a></div></div>
<div class="ttc" id="astructssl_svr_itfc_html"><div class="ttname"><a href="../../dd/dd6/structssl_svr_itfc.html">sslSvrItfc</a></div><div class="ttdef"><b>定义</b> <a href="../../df/d6c/ssl_svr_itfc_8hpp_source.html#l00022">sslSvrItfc.hpp:23</a></div></div>
<div class="ttc" id="astructssl_svr_itfc_html_a48c796d2a1cd0e9a2320443f84d8c2ad"><div class="ttname"><a href="../../dd/dd6/structssl_svr_itfc.html#a48c796d2a1cd0e9a2320443f84d8c2ad">sslSvrItfc::dispatcher_t</a></div><div class="ttdeci">wheels::dm::dispatcher&lt; event &gt; dispatcher_t</div><div class="ttdef"><b>定义</b> <a href="../../df/d6c/ssl_svr_itfc_8hpp_source.html#l00045">sslSvrItfc.hpp:45</a></div></div>
<div class="ttc" id="astructssl_svr_itfc_html_a95757ce1105f2ed0770d8c94aa581898"><div class="ttname"><a href="../../dd/dd6/structssl_svr_itfc.html#a95757ce1105f2ed0770d8c94aa581898">sslSvrItfc::event</a></div><div class="ttdeci">event</div><div class="ttdef"><b>定义</b> <a href="../../df/d6c/ssl_svr_itfc_8hpp_source.html#l00036">sslSvrItfc.hpp:37</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
